Index: flite-1.4-release/config/common_make_rules
===================================================================
--- flite-1.4-release.orig/config/common_make_rules
+++ flite-1.4-release/config/common_make_rules
@@ -61,26 +61,34 @@ OBJDIR=$(BUILDDIR)/obj/$(DIRNAME)
 BINDIR=$(BUILDDIR)/bin
 ifeq ($(HOST_PLATFORM),$(TARGET_PLATFORM))
 BINDIR=$(TOP)/bin
+LIBDIR=$(TOP)/lib
 endif
 
-LIBDIR=$(BUILDDIR)/lib
+#LIBDIR=$(BUILDDIR)/lib
 BUILDDIRS=$(OBJDIR) $(BINDIR) $(LIBDIR)
 
-FLITELIBS = $(BUILDDIR)/lib/libflite.a
-FLITELIBFLAGS = -L$(BUILDDIR)/lib -lflite 
-LDFLAGS += -lm $(AUDIOLIBS) $(OTHERLIBS)
+ifdef SHFLAGS
+FLITELIBS = $(LIBDIR)/libflite.so
+LDFLAGS += -L$(LIBDIR) -lflite $(OTHERLIBS)
+else
+FLITELIBS = $(LIBDIR)/libflite.a
+LDFLAGS += -L$(LIBDIR) -lflite -lm $(AUDIOLIBS) $(OTHERLIBS)
+endif
+
 
 FULLOBJS = $(OBJS:%=$(OBJDIR)/%)
 ifdef SHFLAGS
 SOOBJS = $(OBJS:.o=.os)
-FULLSHOBJS = $(SOOBJS:%=$(OBJDIR)/%)
+FULLSOOBJS = $(SOOBJS:%=$(OBJDIR)/%)
 ifdef LIBNAME
 ALL += $(OBJDIR)/.build_so
 endif
-endif
+else
 ifdef LIBNAME
 ALL += $(OBJDIR)/.build_lib
 endif
+endif
+
 # Only do some directories when you are not cross compiling
 ifeq ($(HOST_PLATFORM),$(TARGET_PLATFORM))
 OTHER_BUILD_DIRS = $(HOST_ONLY_DIRS)
@@ -112,20 +120,21 @@ $(OBJDIR)/.build_lib: $(FULLOBJS)
 	@ $(RANLIB) $(LIBDIR)/lib$(LIBNAME).a
 	@ touch $(OBJDIR)/.build_lib
 
-$(OBJDIR)/.build_so: $(FULLSHOBJS)
+$(OBJDIR)/.build_so: $(FULLSOOBJS)
 	@ (cd $(OBJDIR) && $(AR) cruv ../../../$(LIBDIR)/lib$(LIBNAME).shared.a $(SOOBJS))
 	@ $(RANLIB) $(LIBDIR)/lib$(LIBNAME).shared.a
 	@ touch $(OBJDIR)/.build_so
 
 # Used in the lib/ directory and in building new voices
-$(LIBDIR)/%.so: $(LIBDIR)/%.shared.a
+#$(LIBDIR)/%.so: $(LIBDIR)/%.shared.a
+%.so: %.shared.a
 	@ echo making $@
 	@ rm -rf shared_os && mkdir shared_os
 	@ rm -f $@ $@.${PROJECT_VERSION} $@.${PROJECT_SHLIB_VERSION} 
 	@ (cd shared_os && ar x ../$<)
-	@ (cd shared_os && $(CC) -shared -Wl,-soname,`basename $@`.${PROJECT_SHLIB_VERSION} -o ../$@.${PROJECT_VERSION} *.os)
-	@ (cd $(LIBDIR) && ln -s `basename $@.${PROJECT_VERSION}` `basename $@.${PROJECT_SHLIB_VERSION}` )
-	@ (cd $(LIBDIR) && ln -s `basename $@.${PROJECT_SHLIB_VERSION}` `basename $@` )
+	@ (cd shared_os && $(CC) -shared -Wl,-soname,$@.${PROJECT_SHLIB_VERSION} -o ../$@.${PROJECT_VERSION} *.os -L../ $($(@:%.so=%_LDLIBS)))
+	@ ln -s $@.${PROJECT_VERSION} $@.${PROJECT_SHLIB_VERSION}
+	@ ln -s $@.${PROJECT_SHLIB_VERSION} $@
 	@ rm -rf shared_os
 
 $(OBJDIR)/.make_build_dirs:
Index: flite-1.4-release/lib/Makefile
===================================================================
--- /dev/null
+++ flite-1.4-release/lib/Makefile
@@ -0,0 +1,77 @@
+###########################################################################
+##                                                                       ##
+##                  Language Technologies Institute                      ##
+##                     Carnegie Mellon University                        ##
+##                        Copyright (c) 1999                             ##
+##                        All Rights Reserved.                           ##
+##                                                                       ##
+##  Permission is hereby granted, free of charge, to use and distribute  ##
+##  this software and its documentation without restriction, including   ##
+##  without limitation the rights to use, copy, modify, merge, publish,  ##
+##  distribute, sublicense, and/or sell copies of this work, and to      ##
+##  permit persons to whom this work is furnished to do so, subject to   ##
+##  the following conditions:                                            ##
+##   1. The code must retain the above copyright notice, this list of    ##
+##      conditions and the following disclaimer.                         ##
+##   2. Any modifications must be clearly marked as such.                ##
+##   3. Original authors' names are not deleted.                         ##
+##   4. The authors' names are not used to endorse or promote products   ##
+##      derived from this software without specific prior written        ##
+##      permission.                                                      ##
+##                                                                       ##
+##  CARNEGIE MELLON UNIVERSITY AND THE CONTRIBUTORS TO THIS WORK         ##
+##  DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING      ##
+##  ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT   ##
+##  SHALL CARNEGIE MELLON UNIVERSITY NOR THE CONTRIBUTORS BE LIABLE      ##
+##  FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES    ##
+##  WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN   ##
+##  AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,          ##
+##  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF       ##
+##  THIS SOFTWARE.                                                       ##
+##                                                                       ##
+###########################################################################
+##                                                                       ##
+##    FLITE libraries                                                    ##
+##                                                                       ##
+###########################################################################
+TOP=..
+DIRNAME=lib
+BUILD_DIRS = 
+ALL_DIRS=
+FILES = Makefile
+LIBNAMES = flite flite_cmulex flite_usenglish \
+           flite_cmu_us_kal flite_cmu_us_kal16 flite_cmu_time_awb \
+		   flite_cmu_us_awb flite_cmu_us_rms flite_cmu_us_slt
+
+STATICLIBS= $(LIBNAMES:%=lib%.a)
+SHAREDARLIBS= $(LIBNAMES:%=lib%.shared.a)
+#SHAREDLIBS = $(LIBNAMES:%=lib%.so)
+SHAREDLIBS = $(SHAREDARLIBS:%.shared.a=%.so)
+VERSIONSHAREDLIBS = $(SHAREDLIBS:%=%.${PROJECT_VERSION}) \
+                    $(SHAREDLIBS:%=%.${PROJECT_SHLIB_VERSION})
+ALL_LIBS = $(SHAREDLIBS) $(VERSIONSHAREDLIBS)
+
+ALL = shared_libs
+
+LOCAL_CLEAN=*.a *.so *.so.${PROJECT_VERSION} *.so.${PROJECT_SHLIB_VERSION}
+
+include $(TOP)/config/common_make_rules
+
+ifdef SHFLAGS
+shared_libs: $(SHAREDLIBS)
+libflite_LDLIBS = -lm $(AUDIOLIBS)
+libflite_cmulex_LDLIBS = -lflite
+libflite_usenglish_LDLIBS = -lflite
+libflite_cmu_us_kal_LDLIBS = -lflite_cmulex -lflite_usenglish
+libflite_cmu_us_kal16_LDLIBS = -lflite_cmulex -lflite_usenglish
+libflite_cmu_time_awb_LDLIBS = -lflite -lflite_cmulex -lflite_usenglish
+libflite_cmu_us_awb_LDLIBS = -lflite -lflite_cmulex -lflite_usenglish
+libflite_cmu_us_rms_LDLIBS = -lflite -lflite_cmulex -lflite_usenglish
+libflite_cmu_us_slt_LDLIBS = -lflite -lflite_cmulex -lflite_usenglish
+else
+shared_libs: nothing
+endif
+
+install:
+	@ tar cvf - $(ALL_LIBS) | ( cd $(INSTALLLIBDIR) && tar xf -)
+
Index: flite-1.4-release/main/Makefile
===================================================================
--- flite-1.4-release.orig/main/Makefile
+++ flite-1.4-release/main/Makefile
@@ -54,7 +54,7 @@ VOICELIBS=$(VOICES:%=flite_%)
 flite_LIBS = $(VOICELIBS) $(LANGS:%=flite_%) $(LEXES:%=flite_%) flite
 
 flite_LIBS_flags = -L$(LIBDIR) $(flite_LIBS:%=-l%)
-flite_LIBS_deps = $(flite_LIBS:%=$(LIBDIR)/lib%.a)
+flite_LIBS_deps = $(flite_LIBS:%=$(LIBDIR)/lib%.so)
 
 include $(TOP)/config/common_make_rules
 
@@ -67,7 +67,7 @@ VERSIONSHAREDLIBS = $(SHAREDLIBS:%=%.${P
 
 flite_time_LIBS = flite_cmu_time_awb flite_usenglish flite_cmulex
 flite_time_LIBS_flags = -L$(LIBDIR) $(flite_time_LIBS:%=-l%)
-flite_time_LIBS_deps = $(flite_time_LIBS:%=$(LIBDIR)/lib%.a)
+flite_time_LIBS_deps = $(flite_time_LIBS:%=$(LIBDIR)/lib%.so)
 
 LOCAL_CLEAN = $(BINDIR)/flite$(EXEEXT) $(BINDIR)/flite_time$(EXEEXT) \
               $(BINDIR)/t2p$(EXEEXT) \
Index: flite-1.4-release/Makefile
===================================================================
--- flite-1.4-release.orig/Makefile
+++ flite-1.4-release/Makefile
@@ -42,7 +42,7 @@
 ###########################################################################
 TOP=.
 DIRNAME=
-BUILD_DIRS = include src lang doc
+BUILD_DIRS = include src lang lib doc
 ALL_DIRS=config $(BUILD_DIRS) testsuite sapi palm wince windows tools main
 CONFIG=configure configure.in config.sub config.guess \
        missing install-sh mkinstalldirs
